package org.example.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author zfj
 * @date 2022/2/17 -13:14
 */
//@Configuration   applicationContext.xml
@Configuration
public class ConfigBean {
	//配置负载均衡实现RestTemplate
	@Bean
	@LoadBalanced  //Ribbon基于客户端
	public RestTemplate getTemplate(){
		return new RestTemplate();
	}
}
